<template>
  <!-- 菜单图标 -->
  <template v-if="icon">
    <Icon :icon="icon" :type="type" />
  </template>
  <template v-else>
    <Icon icon="menu" type="svg" />
  </template>
  <!-- 菜单标题 -->
  <span v-if="title" class="menu-title ml-1">{{ title }}</span>
</template>

<script setup>
import { Icon } from '@/components/icon'
defineProps({
  icon: {
    type: String,
  },
  type: {
    type: String,
    default: 'iconify',
  },
  title: {
    type: String,
  },
})
</script>

<style lang="scss" scoped>
.menu-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 16px;
  color: currentcolor;
}
</style>
